package com.googlecode.animator.data.stage
{
	import com.googlecode.animator.data.IValueObject;
	import com.googlecode.animator.data.ValueObject;

	public class StagePropertiesVO extends ValueObject
	{
		public static const TYPE:String = "stage";
		
		public var stageWidth:uint = 640;
		
		public var stageHeight:uint = 480;
		
		public var workAreaVisible:Boolean = false;
		
		override public function clone(src:* = null):IValueObject
		{	
			if(src == null)
			{
				src = new StagePropertiesVO();
			}else
			{
				src = super.clone(src);
			}
			
			(src as StagePropertiesVO).stageWidth = this.stageWidth;
			
			(src as StagePropertiesVO).stageHeight = this.stageHeight;
			
			(src as StagePropertiesVO).workAreaVisible = this.workAreaVisible;

			return (src as StagePropertiesVO);					
		}
		
		override public function toXML(src:XML = null):XML
		{
			var xml:XML = super.toXML(new XML(<{TYPE}></{TYPE}>));
			
			xml.appendChild(<stageWidth>{this.stageWidth}</stageWidth>);
			xml.appendChild(<stageHeight>{this.stageHeight}</stageHeight>);

			return xml;
		}
		
		override public function fromXML(src:XML):void
		{
			super.fromXML(src);
			
			this.stageWidth = src.stageWidth;
			this.stageHeight = src.stageHeight;
	
		}
	}
}